package com.hhp.hhptt.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hhp.hhptt.entity.TMap;
import com.hhp.hhptt.mapper.TMapMapper;
import com.hhp.hhptt.service.TMapService;
import com.hhp.hhptt.utils.ServletUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Demo
 * @Author LiTianYu
 * @Date 2024/6/14 15:05
 */
@Service
public class TMapServiceImpl extends ServiceImpl<TMapMapper, TMap>
        implements TMapService {
    @Autowired
    private TMapMapper tMapMapper;
    @Override
    public List<TMap> findAll() {
        List<TMap> tMaps = tMapMapper.selectList(null);
        for (TMap tMap : tMaps) {
            tMap.setImageUrl(ServletUtils.getImageUrl(tMap.getImageUrl()));
            tMap.setIconPath(ServletUtils.getImageUrl(tMap.getIconPath()));
        }
        return tMaps;
    }
}
